import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
  //用@表示src要目录
  resolve: {
    alias: {
      '@': '/src'
    }
  },
  plugins: [vue()],
  server:{
    host:'localhost',
    port: 3000,
    proxy:{
      '/api':{
        target:'http://localhost:8082',
        changeOrigin:true,
        rewrite:(path)=>{
          return path.replace(/^\/api/,'')
        }
      }
    }
  }
})
